﻿
using System;
using System.Text;
using System.Collections.Generic;
using System.Data;
using Kevin.Framework.Data.OrmMapping;
using Kevin.Framework.Validation;
/*------------------------------------------------------------------------
   苏州捷安信息科技有限公司 版权所有			
   文件名: TU_Role.cs
   作 者 : 席吉波
   日 期 : 2012-10-16
   备 注 : 当您对本文件更改时请写明修改人、修改日期以及事由
  ------------------------------------------------------------------------
*/
namespace JOIN.Rights.Model
{
    //TU_Role
    [Serializable]
    [TableMapping("TU_Role")]
    public class RoleInfo : EntityBase
    {
        #region Constructor

        public RoleInfo()
            : this("")
        { }
        public RoleInfo(string connectionKey)
            : base(connectionKey)
        { }

        #endregion

        private string _id;
        /// <summary>
        /// ID
        /// </summary>		
        [FieldMapping("ID", PrimaryKey = true)]
        public string ID
        {
            get
            {
                return _id;
            }
            set
            {
                if (_id != value)
                {
                    base.OnPropertyChanged("ID", _id, value);
                    _id = value;
                }
            }
        }

        private string _roleid;
        /// <summary>
        /// 角色ID
        /// </summary>		
        [FieldMapping("RoleID")]
        public string RoleID
        {
            get
            {
                return _roleid;
            }
            set
            {
                if (_roleid != value)
                {
                    base.OnPropertyChanged("RoleID", _roleid, value);
                    _roleid = value;
                }
            }
        }

        private string _rolename;
        /// <summary>
        /// 角色名
        /// </summary>		
        [FieldMapping("RoleName")]
        [NotNullValidator(MessageTemplate = "角色名不能为空")]
        public string RoleName
        {
            get
            {
                return _rolename;
            }
            set
            {
                if (_rolename != value)
                {
                    base.OnPropertyChanged("RoleName", _rolename, value);
                    _rolename = value;
                }
            }
        }

        private string _roledesc;
        /// <summary>
        /// 描述
        /// </summary>		
        [FieldMapping("RoleDesc")]
        public string RoleDesc
        {
            get
            {
                return _roledesc;
            }
            set
            {
                if (_roledesc != value)
                {
                    base.OnPropertyChanged("RoleDesc", _roledesc, value);
                    _roledesc = value;
                }
            }
        }

        private string _projectid;
        /// <summary>
        /// ProjectID
        /// </summary>		
        [FieldMapping("ProjectID")]
        [NotNullValidator(MessageTemplate = "不能为空")]
        public string ProjectID
        {
            get
            {
                return _projectid;
            }
            set
            {
                if (_projectid != value)
                {
                    base.OnPropertyChanged("ProjectID", _projectid, value);
                    _projectid = value;
                }
            }
        }

        [FieldMapping("ProjectName","TU_Project","ProjectID","ProjectID")]
        [SqlBehavior(BindingFlags=ClauseBindingFlags.Select | ClauseBindingFlags.Where)]
        public string ProjectName
        {
            get;
            set;
        }

    }
}